package main

import (
	"fmt"
)

type USB interface {
	Name() string
	Connector
}

type empty interface {

}

type Connector interface {
	Connect()
}

type PhoneConnector struct {
	name string
}

func (pc PhoneConnector) Name() string {
	return pc.name
}

func (pc PhoneConnector) Connect()  {
	fmt.Println("Connect:", pc.name)
}

func main() {
	pc := PhoneConnector{"PhoneConnector"}
	var a Connector
	a = Connector(pc)
}

func Disconnect(usb USB)  {
	/*
	if pc, ok := usb.(PhoneConnector); ok{
		fmt.Println("Disconnect", pc.name)
		return
	};
	*/

	switch v:= usb.(type){
	case PhoneConnector:
		fmt.Println("Disconnected", v.name)
	default:
		fmt.Println("Unknown device.")
	}

}
